#include <iostream>
#include "../Server/Http/Http.hpp"

int main()
{
    // std::string src = "abc,,,,defm,eee,";
    // std::vector<std::string> sub_strs;
    // size_t size = Tool::StrSplit(src,",",sub_strs);
    // for(auto & sub:sub_strs)
    // {
    //     std::cout<<sub<<std::endl;
    // }

    // std::string buff;
    // bool ret = Tool::ReadFile("./TcpClient.cc",buff);
    // if(!ret) return -1;
    // //std::cout<<buff<<std::endl;
    // ret = Tool::WriteFile("./test_write_file.cc",buff);
    // if(!ret) return -1;
    // //e516e30d822fe77ba885438e88d3581d  TcpClient.cc
    // //e516e30d822fe77ba885438e88d3581d  test_write_file.cc

    // std::string str = "C  ";
    // std::string ret1 = Tool::UrlEncode(str,ENABLE_SPACE_TO_PLUS);
    // std::cout << ret1 << std::endl;
    // std::string ret2 = Tool::UrlDecode(ret1,ENABLE_SPACE_TO_PLUS);
    // std::cout << ret2 << std::endl;

    // std::cout<<Tool::GetStatuDesc(200)<<std::endl;
    // std::cout<<Tool::GetStatuDesc(502)<<std::endl;
    // std::cout<<Tool::GetStatuDesc(403)<<std::endl;
    // std::cout<<Tool::GetStatuDesc(800)<<std::endl;

    // std::cout<<Tool::GetMimeType("a.txt")<<std::endl;
    // std::cout<<Tool::GetMimeType("b.jpg")<<std::endl;
    // std::cout<<Tool::GetMimeType("c.html")<<std::endl;

    // std::cout<<Tool::IsDirectory("TcpClient.cc")<<std::endl; // 0
    // std::cout<<Tool::IsRegularFile("EchoServer")<<std::endl; // 0

    // std::cout<<Tool::IsDirectory("EchoServer")<<std::endl;     // 1
    // std::cout<<Tool::IsRegularFile("TcpClient.cc")<<std::endl; // 1

    // std::cout<<Tool::IsPathValid("/index.html")<<std::endl; // 1
    // std::cout<<Tool::IsPathValid("/index.html/../index.html")<<std::endl; // 1
    // std::cout<<Tool::IsPathValid("/index.html/../../index.html")<<std::endl; // 0
    // std::cout<<Tool::IsPathValid("/../index.html")<<std::endl; // 0
    // HttpResponse res;
    // res.SetBody("hello,wwwwwxxxxxddddd");
    // res._status_code = 200;
    // res.SetHead("Content-Length", std::to_string(res._body.size()));
    // res.SetHead("Content-Type", Tool::GetMimeType("404.html"));
    // std::string res_str = res.Serialize();
    // std::cout << res_str << std::endl;
    return 0;
}